package com.yz.group5.med_booking.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yz.group5.med_booking.entity.Appointment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

// 继承MyBatis-Plus的BaseMapper接口，获得基本的CRUD操作
@Mapper
public interface AppointmentMapper extends BaseMapper<Appointment> {

    // 根据用户ID查询预约记录
    List<Appointment> findByUserId(@Param("userId") Integer userId);

    // 根据科室ID查询预约记录
    List<Appointment> findByDepartmentId(@Param("departmentId") Integer departmentId);

    // 根据医生ID查询预约记录
    List<Appointment> findByDoctorId(@Param("doctorId") Integer doctorId);

    // 根据预约状态查询记录
    List<Appointment> findByStatus(@Param("status") Integer status);
}
